package com.atguigu.gmall.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.atguigu.gmall.order.entity.OrderDetail;
import com.atguigu.gmall.order.service.OrderDetailService;
import com.atguigu.gmall.order.mapper.OrderDetailMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author weiranyi
 * @description 针对表【order_detail(订单明细表)】的数据库操作Service实现
 * @createDate 2022-12-20 11:16:23
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail>
        implements OrderDetailService {

    @Override
    public List<OrderDetail> getDetails(Long userId, Long orderId) {
        List<OrderDetail> list = lambdaQuery()
                .eq(OrderDetail::getUserId, userId)
                .eq(OrderDetail::getOrderId, orderId)
                .list();
        return list;
    }
}




